/************************************************************************************\
This source file is part of the Universal Actor Library                              *
For latest info, see http://libuniactor.sourceforge.net/                             *
**************************************************************************************
Copyright (c) 2010 Kresimir Spes (kreso@cateia.com)                                  *
*                                                                                    *
* This program is free software; you can redistribute it and/or modify it under      *
* the terms of the BSD license: http://www.opensource.org/licenses/bsd-license.php   *
\************************************************************************************/

/************************************************************************************
COPYRIGHT INFO: Sprite animation has been borrowed with authors permission from the game:
Game:   Kaptain Brawe ( http://www.naphtalite.com )
Author: Petar Ivancek

These animations ARE NOT ALLOWED to be used in any manner other then for the purpose
of this demo program.
*************************************************************************************/
#define __DEV_IL
#include "../demo_basecode.h"
#include "UniActor/Actor.h"
#include "UniActor/Jobs.h"
#include "../glSprite2D.h"

std::string window_name="demo_sprite";
bool started=1;
int window_w=800,window_h=600;

glSprite2D* actor;

void draw()
{
	actor->draw();
}

void update(float time_increase)
{
	actor->update(time_increase);
}

void OnKeyPress(int key)
{

}

void OnClick(float x,float y)
{
	actor->clearJobs();
	actor->addJob(new UniActor::Jobs::Move(x,y,0));
}

void setDebugTitle(char* out)
{

}

void init()
{
	glClearColor(0.7f,0.7f,0.7f,1);
	loadSprite("../media/brawe/brawe.sprite");
	actor=new glSprite2D();
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}

void destroy()
{
	delete actor;
}
